home *** CD-ROM | disk | FTP | other *** search
- Path: informatik.tu-muenchen.de!fischerj
- From: fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: PPC compilers
- Date: 1 Jan 1996 21:01:09 GMT
- Organization: Technische Universitaet Muenchen, Germany
- Distribution: world
- Message-ID: <4c9i2l$h3i@sunsystem5.informatik.tu-muenchen.de>
- References: <john.hendrikx.40ka@grafix.xs4all.nl> <4b77tq$htp@serpens.rhein.de> <MQAQx*XOe@yaps.rhein.de> <4bqhnf$6g5@sunsystem5.informatik.tu-muenchen.de> <jasonb.820051107@cs.uwa.edu.au>
- NNTP-Posting-Host: hphalle5.informatik.tu-muenchen.de
- X-Newsreader: TIN [version 1.2 PL2]
-
- Jason S Birch (jasonb@cs.uwa.edu.au) wrote:
- : fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) writes:
-
- : >Arno Eigenwillig (arno@yaps.rhein.de) wrote:
- : >: In article <4bd6ti$rad@sunsystem5.informatik.tu-muenchen.de>, Juergen "Rally" Fischer writes:
- : >: > C is more complex, for example you can't tell me the word-width of
- : >: > "*a++=*b;"
-
- : But you can't say whether move.w (a0)+,(a1)+ is what you want without
- : knowing what a0 and a1 are pointing to any more than you can with C.
-
- yes, but in the C example you even don't know if it's .w, TAIC.
-
- : [...]
-
- : >: > and you even can't tell me how much is postadded to a.
- : >: Of course you can - 1 will be added. Before you try to say anything
- : >: about word widths in reply, find out about C pointer math.
-
- : >int *a(int *p)
- : >{
- : > p++; return p;
- : >}
-
- : [...]
-
- : >_a:
- : > movel sp@(4),d0
- : > addql #4,d0
-
- : >so how comes that your "1" turns a #4 in asm ? oops ;)
-
- : You should have followed his advice. :-) What he's saying is that "1"
- : of whatever the variable size is will be added to a, which is one of
- : the main points of a higher level language (although C isn't much more
- : than a macro assembler on steroids...). True, you don't know exactly
- : how many bytes will be added to the pointer without checking the type
- : of the pointer first, while in assembler you know exactly how many
- : bytes will be added - but, OTOH, the fact that the compiler takes care
- : of adding the right number of bytes all the time removes yet another
- : avenue for error - with assembler, you have to repeatedly *tell* it how
- : many, and if just one of those is wrong...
-
- Yes, I never claimed the opposite :) I did make a claim about a very special
- example.
-
- : >indeed true, for example the "clr.w = read-write on 68000" thing.
- : >the fact that asm isn't 100.0% clear does not change the fact that
- : >the C version (see example) is less clear.
- : >no faulty logic.
-
- : The C version is only less clear in that the one line of code you're
- : looking at doesn't tell you exactly what the computer will do. It's
-
- YOU GOT IT! TAIC! THAT'S IT! I didn't make different claims.
- And when you think this is the buggy line you focus it, and the
- asm line gives more info, and in this _special_ case asm is imho
- easeier debugging.
-
- : > fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) =:)
-
- : --
- : Jason S Birch ,-_|\ email: jasonb@cs.uwa.edu.au
- : Department of Computer Science / \ Tel (work): +61 9 380 1840
- : The University of Western Australia *_.-._/ Fax (work): +61 9 380 1089
- : Nedlands W. Australia 6907 v Tel (home): +61 9 386 8630
-
- -----------------------------------------------------------------------------
- // fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)
- //
- \X/ My wishes for '96:
- may the AT promises come true. Amiga's back.
- -----------------------------------------------------------------------------
-